package test.db.table.oracle.type;

import test.db.table.Table;

/**
 * @author newbie
 * @since 0.1
 */
public enum PwBadTable implements Table, ColumnType {
    SID(Column.sid),
    TARGET_SID(Column.targetSid),
    BAD_TARGET(Column.badTarget),
    TYPE_CODE(Column.typeCode),
    CONTENT(Column.content),
    USER_SID(Column.userSid),
    USER_IP(Column.userIp),
    REGIST_TIMESTAMP(Column.registTimestamp);
    
    private final Column column;
    private static final String TYPE_TARGET_SID = "VARCHAR2(18)";
    private static final String TYPE_BAD_TARGET = "VARCHAR2(12)";
    private static final String TYPE_TYPE_CODE = "VARCHAR2(12)";
    private static final String TYPE_CONTENT = "VARCHAR2(2000)";

    PwBadTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        sid {
            String getType() {
                return TYPE_SID;
            }
        },
        
        targetSid {
            String getType() {
                return TYPE_TARGET_SID;
            }
        },
        
        badTarget {
            String getType() {
                return TYPE_BAD_TARGET;
            }
        },
        
        typeCode {
            String getType() {
                return TYPE_TYPE_CODE;
            }
        },
        
        content {
            String getType() {
                return TYPE_CONTENT;
            }
        },
        
        userSid {
        	String getType() {
        		return TYPE_USER_SID;
        	}
        },
        
        userIp {
            String getType() {
                return TYPE_USER_IP;
            }
        },
        
        registTimestamp {
            String getType() {
                return TYPE_REGIST_TIMESTAMP;
            }
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
    }
}